﻿using Mimas.Framework.Server.DomainObjects;
using Mimas.Framework.Server.DomainObjects.Mapping;
using Mimas.Framework.Shared.Data.DataTransferObjects;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mimas.Framework.Server.PublicServiceManagement
{
    public static class PublicServiceManagementBL
    {
      public static UserDTO[] Test()
      {        
        List<UserDTO> result = new List<UserDTO>();

        using (MIMASEntities db = new MIMASEntities())
        {
         DbSet<User> UserSet = db.Set<User>();

          var Linq = from u in UserSet select u;
          
          var LinqResult = Linq.ToArray();

          if (LinqResult != null && LinqResult.Any())
          {
            result = UserMapping.Map(LinqResult).ToList();
          }
        }
        return result.ToArray();
      }
    }
}
